Squid + SquidGuard
2017/06/26 |
Configure SquidGuard which is the URL redirector to use blacklists.
|
|
[1] | Install and Configure SquidGuard. |
root@prox:~#
root@prox:~# apt -y install squidguard mv /etc/squidguard/squidGuard.conf /etc/squidguard/squidGuard.conf.bk
root@prox:~#
vi /etc/squidguard/squidGuard.conf # create new ( simply settings as an example )
dbhome /var/lib/squidguard/db logdir /var/log/squidguard dest deny { # define 'deny' category for prohibited domain domainlist deny/domains # define 'deny' category for prohibited URL urllist deny/urls } acl { default { # permit all except 'deny' category pass !deny all # the redirected URL if matchs 'deny' redirect http://www.srv.world/error.html } } mkdir /var/lib/squidguard/db/deny
root@prox:~#
vi /var/lib/squidguard/db/deny/domains # write domains you'd like to prohibit to access
yahoo.co.jp
example.com
root@prox:~#
vi /var/lib/squidguard/db/deny/urls # write URLs you'd like to prohibit to access
www.yahoo.co.jp/deny/
www.example.com/ squidGuard -C all
root@prox:~#
chown -R proxy. /var/lib/squidguard /var/log/squidguard
root@prox:~#
vi /etc/squid/squid.conf # line 4449: add url_rewrite_program /usr/bin/squidGuard
systemctl restart squid
|
[2] | Try to access to the URL you set as prohibited domains in [1]. |